package com.bbx.androidapi.util;

import android.content.Context;

public class ResUtil {

	public static final String RES_TYPE_LAYOUT = "layout";
	public static final String RES_TYPE_ID = "id";
	public static final String RES_TYPE_DRAWABLE = "drawable";
	public static final String RES_TYPE_STRING = "string";
	public static final String RES_TYPE_ARRAY = "array";
	public static final String RES_TYPE_ANIM = "anim";
	public static final String RES_TYPE_RAW = "raw";
	public static final String RES_TYPE_STYLEABLE = "styleable";

	public static int getResByType(Context context, String type, String name) {
		if (StringUtil.isNotNullString(type)) {
			return context.getResources().getIdentifier(name, type,
					context.getPackageName());
		}
		return 0;
	}

}
